//
//  main.cpp
//  list
//
//  Created by chenyh on 2021/2/4.
//

#include <iostream>
#include "list.hpp"
using namespace std;
int main(int argc, const char * argv[]) {
    
    SeqList<int> list(10);               //建立顺序表
    for (int i = 0; i < 10; i++) {
        list.insertElement(i*10);       //插入数据实现初始化
    }
    //输出初始化后的顺序表
    for (int i = 0; i < list.getLenght(); i++) {
        cout<<list.getElement(i)<<"  ";
    }
    cout<<endl;
    //删除索引为3的元素
    list.deleteElement(3);
    //输出删除元素后的顺序表
    for (int i = 0; i < list.getLenght(); i++) {
        cout<<list.getElement(i)<<"  ";
    }
    cout<<endl;
    //将顺序表索引为5的元素值修改为44
    list.changeElement(5, 44);
    //输出修改后的顺序表
    for (int i = 0; i < list.getLenght(); i++) {
        cout<<list.getElement(i)<<"  ";
    }
    cout<<endl;
    return 0;
}
